import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],

  // 服务器配置
  server: {
    host: '0.0.0.0',
    port: 8080,
    open: true,
    cors: true,
    // https: true,
    // 代理配置：
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }  
    }
  }
})
